﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="LinqDemo._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <%--<asp:Button ID="btnView" runat="server" Text="View" OnClick="btnView_Click" />
    <asp:Button ID="btnAddNew" runat="server" Text="Add New" OnClick="btnAddNew_Click" />--%>
    <table id="tblForm" runat="server">
        <tr>
            <td>用户名:</td>
            <td><asp:TextBox ID="txtCountryName" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td>密&nbsp; &nbsp;码:</td>
            <td><asp:TextBox ID="txtCountryCode" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btnSave" runat="server" Text="Add" OnClick="btnSave_Click" CssClass="btnSaveCancel"/>
                <asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" CssClass="btnSaveCancel"/>                
            </td>
        </tr>
    </table>
    <br />
    <table id="tblGrid" runat="server">
        <tr>
            <td><asp:Label ID="lblID" runat="server" Visible="true"></asp:Label>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"  
                    CssClass="grid-view" onrowcommand="GridView1_RowCommand">
                <HeaderStyle CssClass="header" />
                <RowStyle CssClass="normal" />
                <AlternatingRowStyle CssClass="alternate" />
                    <Columns>
                        <asp:BoundField DataField="id" HeaderText="序号" />
                        <asp:BoundField DataField="userName" HeaderText="用户名" />
                        <asp:BoundField DataField="password" HeaderText="密码" />
                        <asp:TemplateField HeaderText="Action">
                            <ItemTemplate >
                                <asp:LinkButton ID="lnkEdit" runat="server" CommandArgument='<%# Eval("id")%>'
                                    CommandName="cmdEdit" Text="Edlit"></asp:LinkButton>
                                &nbsp;&nbsp;---&nbsp;&nbsp;
                                <asp:LinkButton ID="lnkDelete" runat="server" CommandArgument='<%# Eval("id")%>'
                                    CommandName="cmdDelete" Text="Delete"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

